<template id="share">
    <div class="s_f share_m">
       <!-- <v-head></v-head>-->
        <!--<v-banner></v-banner>-->
        <div id="share_1">
        <img class="fruits_img" alt="" v-lazy='ima_lazy' id="share_one">
        <div class="share_con">
		
            <div class="share_c"  v-for="(item, index) in items">
                <div class="img_c">
                    <img  class='k_u' src="../image/kuang.png" alt="">
                    <h2>GIFE:{{item.goods_name}}</h2>
                </div>
                <div class="share_rou">
					<img :src="item.thumb">
                    <!--  <div class="bai"></div>-->
                    <div class="height_share">
                        <h3>{{item.goods_brief}}</h3>
                        <p>{{item.notes}}</p>
                        <p>
						参考价：￥{{item.money}}						
						</p>
                         <span @click="share(item.goods_id)" >点击分享>></span>
                    </div>
                </div>
              
               <p class="goods_id" v-show='false'>{{item.goods_id}}</p>
            </div>
			     
             <p id="goods_id" v-show='false'></p>
        </div>
        </div>


       <!-- <v-footer></v-footer>-->
    </div>

</template>

<script>
    /*import banner from './banner.vue'*/
   /* import head from './head.vue';*/
   /* import footer from './footer.vue';*/
    import Vue from 'vue'
    import VueLazyload from 'vue-lazyload'  //引入这个懒加载插件
    Vue.use(VueLazyload, {
        preLoad: 1.3,
        error: '/src/image/1392662591495_1140x0.gif',  //图像的src加载失败
        loading: '/src/image/1392662591495_1140x0.gif', //src的图像加载
        attempt: 1,
        listenEvents: [ 'scroll', 'mousewheel' ]
    });
    export default {
        name:'share',
        data(){
            return{
                items:[],
                img:[],
                share_info:[],
                type:'activity',
                time:this.$route.query.time,
                ima_lazy:'/dist/top.png'
            }
        },
       /* components:{
          /!*'v-head':head,*!/
         /!* 'v-footer':footer,*!/
          'remote-js': {render(createElement) {
              return createElement('script', { attrs: { type: 'text/javascript', src: this.src }});
            },
            props: {
              src: { type: String, required: true },
            },
          },
        },*/
        mounted:function(){
            //初始化
            if(init.isWeiXin()){
                share.share_wx();
                share.type ='activity';
                share.share();
            }else{
                share.type ='activity';
                share.share_web()
            }


            //获取活动信息
            this.share_gift();
            /*不用减去滚动条的高度*/
            /*let H = $(window).height()-90
            $('#share_1').height(H)*/

            //全局事件 
            $("body").click(function(){
                share.onReady();
            });

        },
		methods: {
            share_gift(){
                let url  = this.GLOBAL.BaseUrl+'/mobile/api/v1/Public.php?mode=share_gift';
                let Data = this.GLOBAL.dataParam();
                this.$ajax.post(url,Data).then((res) => {
                    let temp = res.data;
                    if(temp.code == 200){
                        this.items = temp.data;
                    }else{
                        this.GLOBAL.center_error(this,temp);        
                    }  
                })
            },
            share(id){
                let is_wx = init.isWeiXin();

                $("#goods_id").html(id);
                if(is_wx){
                   alert("请从右上角点击分享");
                   return; 
                }else{
                   //页面分享
                    if(!init.getCookie('uid') && !init.getCookie('time') && !init.getCookie('token')){
                         alert("请登录分享");
                    }else{
                         $("#share_web").click();
                    }
                  
                }
            }
		  }
       
    }
		
    
</script>
<style>
   .share_m .hide{
      display: none;
    }
   .share_m #share_1{
        overflow-y: scroll;
    }
    /*.s_f{
        overflow-x:hidden;
        overflow-y:hidden;
        -webkit-overflow-scrolling: touch;
    }*/
    /*.bai{
        width:2.4rem;
        height:1.6rem;
        background:#ffffff;
        opacity:0.5;
        filter:alpha(opacity=50);
        position:absolute;
        top: 133px;
        left: 165px;
        border-radius:8px;

    }*/
    .share_m  #tu{
        left: 0.3rem;
        top: 2.3rem;
    }
   .share_m  .height_share{
        height:1.77rem;
        width:2.3rem;
        position:absolute;
        top: 2.4rem;
		left: 0.5rem;

    }
    .share_m .height_share h3{
        color:#d4b986;
        font-size:0.22rem;
        margin:0;
        padding:0;
        line-height:0.43rem;
        height: 0.43rem;
        text-align:center;
    }
    .share_m .height_share p:nth-of-type(1){
        height:0.37rem;
        color:#d4b986;
        font-size:0.18rem;
        line-height:0.37rem;
        text-align:center;
        margin:0;
        padding:0;
        width:2.4rem;
    }
   .share_m  .height_share p:nth-of-type(2){
        height:0.39rem;
        color:#b79d6a;
        font-size:0.2rem;
        line-height:0.39rem;
        text-align:center;
        margin:0;
        padding:0;
        width:2.4rem;
        font-weight:700;
        margin-bottom:10px;

    }
   .share_m  .height_share span{
        display:block;
        height:0.38rem;
        width:1.9rem;
        color:#ffffff;
        background:#fa6aa4;
        border-radius: 10px;
        font-size:0.23rem;
        text-align:center;
        line-height:0.38rem;
        margin-left:10px;
    }
	.share_m .height_share a{
		text-decoration: none;
	}

  .share_m .fruits_img{
      display:block;
      height:4.78rem;
      width:100%;
  }
  .share_m .share_rou img{
      height:2.8rem;
      width:5.4rem;
      display:block;
      margin:0 0.16rem 0.16rem 0.16rem;
  }
  .share_m .share_rou{
      height:3.3rem;
      width:5.8rem;
  }
  .share_m .img_c{
      height:1.21rem;
      width:4.81rem;
      position:relative;
  }
  .share_m .img_c h2{
      position:absolute;
      font-size:0.3rem;
      color:#d4b986;
      left: 0.97rem;
      top: 13px;
      margin:0;
      padding:0;
  }
  .share_m .k_u{
      display:block;
      height:0.75rem;
      width:4.81rem;
      margin:0.3rem 0.6rem  0.36rem 0.6rem
  }
  .share_m .share_c{
      height:4.7rem;
      width:5.7rem;
      border:12px solid #e3cb9e;
      margin: 0 0.15rem 0.3rem 0.15rem;
      background:#ffffff;
      position:relative;
  }
   .share_m .share_c:last-of-type{
       margin-bottom:0;
   }
  .share_m .share_con{
        padding-top: 10px;
        min-height:5.5rem;
        width:100%;
        margin-top:-0.2rem;
        background:url(../image/bg.png) repeat;
        background-size:cover;
    }
</style>